//
//  OEShopGoodTableViewCell.m
//  OneEightyNine
//
//  Created by Mac on 2019/3/7.
//  Copyright © 2019 stoneobs. All rights reserved.
//

#import "OECommitOrderTableViewCell.h"

@interface  OECommitOrderTableViewCell()
@property(nonatomic, strong) UIImageView                     *iconImageView;/**<  */
@property(nonatomic, strong) STLabel                     *nameLable;/**<  */
@property(nonatomic, strong) STLabel                     *moneyLable;/**<  */

@end
@implementation OECommitOrderTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self == [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self configSubView];
    }
    return self;
}
+ (CGFloat)cellHeight{
    return 90;
}
#pragma mark --subView
- (void)configSubView{
    UIImageView * imageView = [[UIImageView alloc] initWithFrame:CGRectMake(10, 0, 80, 80)];
    imageView.image = [UIImage imageNamed:@""];
    [self addSubview:imageView];
    self.iconImageView = imageView;
    
    self.nameLable = [[STLabel alloc] initWithFrame:CGRectMake(self.iconImageView.right + 10, self.imageView.top, 200, 44)
                                               text:@""
                                          textColor:FirstTextColor
                                               font:15
                                        isSizetoFit:NO
                                      textAlignment:NSTextAlignmentLeft];
    [self addSubview:self.nameLable];
    
    self.moneyLable = [[STLabel alloc] initWithFrame:CGRectMake(self.iconImageView.right + 10, self.imageView.top, 200, 25)
                                                text:@""
                                           textColor:FirstTextColor
                                                font:15
                                         isSizetoFit:NO
                                       textAlignment:NSTextAlignmentLeft];
    self.moneyLable.bottom = self.iconImageView.bottom;
    [self addSubview:self.moneyLable];
    

    
    self.numLable = [[STLabel alloc] initWithFrame:CGRectMake(self.imageView.right + 10, self.imageView.top, 100, 30)
                                              text:@""
                                         textColor:FirstTextColor
                                              font:15
                                       isSizetoFit:NO
                                     textAlignment:NSTextAlignmentRight];
    [self addSubview:self.numLable];
    self.numLable.bottom = self.iconImageView.bottom;
    self.numLable.right = UIScreenWidth - 15;
    

}

- (void)setModel:(OEGoodModel *)model{
    _model = model;
    [self.iconImageView sd_setImageWithURL:[NSURL URLWithString:model.goods_img]];
    self.nameLable.text = model.goods_name;
    NSString * price = model.shop_price;
    if (!price.length) {
        price = model.goods_price;
    }
    self.numLable.text = [NSString stringWithFormat:@"x%@",model.subtotal_number];
    self.moneyLable.text = [NSString stringWithFormat:@"%@",price];
    
}
@end
